{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "initial_id",
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "arr1d=np.array([1,2,3])\n",
    "import numpy as np\n",
    "arr2d=np.array([[1,2,3],[4,5,6],[7,8,9]])\n",
    "import numpy as np\n",
    "arr3d=np.array([[1,2,3],[4,5,6],[7,8,9]])\n",
    "np.empty((2,3))\n",
    "array([[6.23042070e-307, 4.67296746e-307, 1.69121096e-306],\n",
    "       [1.33508930e-307, 1.89146896e-307, 7.56571288e-307]])\n",
    "np.linspace(1,20,6)\n",
    "#array([1.,4.8,8.6,12.4,16.2,20.])\n",
    "array([ 1. ,  4.8,  8.6, 12.4, 16.2, 20. ])\n",
    "data=np.array([[1,2,3],[4,5,6]])\n",
    "float_data=data.astype(np.float32)\n",
    "float_data.dtype.name\n",
    "'float32'\n",
    "float_data=np.array([1.2,2.9,3.5])\n",
    "int_data=data.astype(np.int32)\n",
    "int_data\n",
    "array([[1, 2, 3],\n",
    "       [4, 5, 6]], dtype=int32)\n",
    "str_data=np.array(['1','2','3'])\n",
    "int_data=str_data.astype(np.int64)\n",
    "int_data\n",
    "array([1, 2, 3])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
